﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace CardInChina.Common.Tool
{
    public class MD5
    {
        /// <summary>
        /// 不支持中文
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static string GetHash(string msg)
        {
            Byte[] md = (new MD5CryptoServiceProvider()).ComputeHash((System.Text.Encoding.UTF8).GetBytes(msg));
            StringBuilder sb = new StringBuilder(BitConverter.ToString(md));
            sb.Replace("-", "");
            return sb.ToString();
        }
    }
}
